package com.yjd.api.util;

import com.yjd.comm.resource.model.ResourceModel;
import com.yjd.comm.util.ServletUtil;
import com.yjd.comm.util.StringUtil;

import java.util.List;

/**
 * Created by yjd-wap on 2017/7/4.
 */
public class PicsResourceUtils {

    public static String getPicsList(List<ResourceModel> resourceList, Long ref_id)throws Exception{
        String picsUrl = "";
        if(resourceList!=null&&ref_id!=null){
            for (ResourceModel resourceModel:resourceList){
                if(ref_id.intValue() == resourceModel.getRef_id()){
                    if(!StringUtil.isEmpty(resourceModel.getPath()) ){
                        picsUrl = resourceModel.getPath();
                        break;
                    }
                }
            }
        }
        return picsUrl;
    }

}
